package model

// 本表和User表为多对一的关系，User表的主键作为Video表的外键
// 视频
type Video struct {
	Id            int64  `json:"id,omitempty" gorm:"primaryKey;not null;autoIncrement"` //autoIncrement元素表示自增
	Author        User   `json:"author" gorm:"foreignKey:Id;references:UserId;not null"`
	UserId        int64  `json:"user_id" gorm:"not null"`
	PlayUrl       string `json:"play_url,omitempty"  gorm:"size:512"`
	CoverUrl      string `json:"cover_url,omitempty" gorm:"size:512"`
	FavoriteCount int64  `json:"favorite_count,omitempty" gorm:"size:256"`
	CommentCount  int64  `json:"comment_count,omitempty" gorm:"size:256"`
	IsFavorite    bool   `json:"is_favorite,omitempty"`
	Title         string `json:"title,omitempty" gorm:"size:256"`
}
